package message

import (
	"encoding/json"
)

const (
	None      = 0
	Heartbeat = 1
)

// / 返回code 错误列表
const (
	ErrorMsg           = -1
	Success            = 0
	SCoginRoomIdError  = 10001 /// 房间id错误
	SCLoginUserIdError = 10002 /// 用户id错误

	SCLoginFail = 10003 /// 登录错误

	CSStartTask            = 10100 /// 开启任务
	SCStartTask            = 10101
	SCStartCommentTaskFail = 10105
	SCStartGiftTaskFail    = 10106
	SCStartLikeTaskFail    = 10107

	SCLiveCommentMsg  = 20001
	SCLiveGiftMsg     = 20002
	SCLiveLikeMsg     = 20003
	SCLiveGroupSelect = 20004

	CSCheckTask = 10200 /// 检查任务状态

	CSSyncGameStatus = 30001 /// 同步对局状态

	SC_KS_AnchorInfo = 1010001 ///推送快手主播信息
)

type Message struct {
	UserId  string // 玩家id
	RoomId  string // 房间id
	MsgType uint64
}

// 需要重写此方法才能完整的msg转byte[]
func (msg *Message) MarshalBinary() ([]byte, error) {
	return json.Marshal(msg)
}
